![]()
API_KEY= "AIzaSyC3aN_T5Is7XrAychgVqBMJtNicjIxgPQE"
Scraping Video details from a Youtube channel using Youtube API. creating a dataset of scrapped data from Youtube. Analysing Dataset and creating Exploratory data analysis report.
#pip install google-auth-oauthlib
#pip install --upgrade google-api-python-client
from googleapiclient.discovery import build
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from IPython.display import JSON
# -*- coding: utf-8 -*-
# Sample Python code for youtube.channels.list
# See instructions for running these code samples locally:
# https://developers.google.com/explorer-help/code-samples#python
import os
import google_auth_oauthlib.flow
import googleapiclient.discovery
import googleapiclient.errors
# Disable OAuthlib's HTTPS verification when running locally.
# *DO NOT* leave this option enabled in production.
os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "1"
api_service_name = "youtube"
api_version = "v3"
youtube = build(
api_service_name, api_version, developerKey=API_KEY)
Ch_ID=["UCY6KjrDBN_tIRFT_QNqQbRQ","UC5cY198GU1MQMIPJgMkCJ_Q","UCHGktfcQq2BY_8tGPHwvm7g","UC5EQWvy59VeHPJz8mDALPxg","UCzh5hQc_O3r3xjh9sXrM7-A",
"UCk3JZr7eS3pg5AGEvBdEvFg","UCCEQKydMgEFIXA4XDshj0CA","UCPyFYlqbkxkWX_dWCg0eekA","UCueYcgdqos0_PzNOq81zAFg",
"UCnjU1FHmao9YNfPzE039YTw","UClVIlK8QHZ2PFkXF97bA0lg","UC20sXo8ReewkzNKBFgzVCPA","UCyKYvZzVUnabf1F7RunRtoQ",
"UC-jxPglhH5SGYlvRRanE_LA","UCsrYnyOJoaLIxCKTRWdy1Cg","UCCPWi_OwWMR5JTiujn7v-7g"]
#can include more channel
def Chanel_detail (youtube,Ch_ID): All_data=[] request = youtube.channels().list(part="snippet,id,statistics,contentDetails,topicDetails,localizations", id=",".join(Ch_ID)) response = request.execute() for i in response["items"]: data={"Chanel_Name":i["snippet"]["title"], "Subscribers":i["statistics"]["subscriberCount"], "Views":i["statistics"]["viewCount"],
#"likes":i["statistics"]["likeCount"],
"Total_videos":i["statistics"]["videoCount"],
"Playlist":i["contentDetails"]["relatedPlaylists"]["uploads"],
"Topic":i["topicDetails"]["topicCategories"][0]
}
All_data.append(data)
df=pd.DataFrame(All_data)
return(df)
def Chanel_detail_1(youtube,Ch_ID):
All_data=[]
request = youtube.channels().list(part="snippet,id,statistics,contentDetails,topicDetails,localizations",
id=",".join(Ch_ID))
response = request.execute()
for i in response["items"]:
data={"snippet":["title","publishedAt","description"],
"statistics":["subscriberCount","viewCount","videoCount","hiddenSubscriberCount"],
}
ch_info={}
ch_info["Channel_ID"]=i["id"]
for x in data.keys():
for y in data[x]:
try:
ch_info[y]=i[x][y]
except:
ch_info[y]=None
ch_info["Playlist"]=i["contentDetails"]["relatedPlaylists"]["uploads"]
ch_info["Topic"]=i["topicDetails"]["topicCategories"][0]
All_data.append(ch_info)
df=pd.DataFrame(All_data)
return(df)
#returns channel details
chanel=Chanel_detail(youtube,Ch_ID) i=np.arange(1,(len(chanel["Chanel_Name"]))+1) chanel.set_index(i,inplace=True)
chanel=Chanel_detail_1(youtube,Ch_ID)
i=np.arange(1,(len(chanel["Channel_ID"]))+1)
chanel.set_index(i,inplace=True)
chanel
| Channel_ID | title | publishedAt | description | subscriberCount | viewCount | videoCount | hiddenSubscriberCount | Playlist | Topic | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | UC-jxPglhH5SGYlvRRanE_LA | Kanmani - Tamil Beauty Tips | 2018-05-06T16:00:16Z | 1100000 | 87293655 | 207 | False | UU-jxPglhH5SGYlvRRanE_LA | https://en.wikipedia.org/wiki/Lifestyle_(socio... | |
| 2 | UC5cY198GU1MQMIPJgMkCJ_Q | Mr. GK | 2017-06-15T10:15:21Z | Please contact me thru my mail id given below.... | 1180000 | 133701029 | 384 | False | UU5cY198GU1MQMIPJgMkCJ_Q | https://en.wikipedia.org/wiki/Knowledge |
| 3 | UCCEQKydMgEFIXA4XDshj0CA | Minutes Mystery | 2017-01-30T12:44:22Z | What a mysterious world we live in! The chatte... | 4630000 | 289232410 | 271 | False | UUCEQKydMgEFIXA4XDshj0CA | https://en.wikipedia.org/wiki/Entertainment |
| 4 | UCk3JZr7eS3pg5AGEvBdEvFg | Village Cooking Channel | 2018-04-25T16:38:11Z | Village grandpa cooking traditional village fo... | 19300000 | 4991717302 | 215 | False | UUk3JZr7eS3pg5AGEvBdEvFg | https://en.wikipedia.org/wiki/Food |
| 5 | UC20sXo8ReewkzNKBFgzVCPA | TAMIL TECH - தமிழ் டெக் | 2016-02-13T18:45:14Z | Tamil Tech is 🌍Worlds "No #1" Top Technology ... | 3590000 | 531296022 | 2366 | False | UU20sXo8ReewkzNKBFgzVCPA | https://en.wikipedia.org/wiki/Technology |
| 6 | UCyKYvZzVUnabf1F7RunRtoQ | Made By Mona | 2017-03-04T14:15:24Z | Follow your Heart...Follow your Passion...Do w... | 372000 | 58587189 | 1109 | False | UUyKYvZzVUnabf1F7RunRtoQ | https://en.wikipedia.org/wiki/Lifestyle_(socio... |
| 7 | UCCPWi_OwWMR5JTiujn7v-7g | Tamil Gaming தமிழ் கேமிங் | 2011-07-08T18:28:48Z | வணக்கம் இது தமிழ் கேமிங் நாங்கள் விவேக் மற்றும... | 419000 | 117129958 | 2020 | False | UUCPWi_OwWMR5JTiujn7v-7g | https://en.wikipedia.org/wiki/Action_game |
| 8 | UCnjU1FHmao9YNfPzE039YTw | Irfan's view | 2009-07-13T14:16:41Z | I love Food and Living. So, I vlog and do Food... | 3430000 | 863725902 | 1786 | False | UUnjU1FHmao9YNfPzE039YTw | https://en.wikipedia.org/wiki/Lifestyle_(socio... |
| 9 | UCPyFYlqbkxkWX_dWCg0eekA | Eruma Saani | 2017-04-25T13:38:26Z | Eruma Saani is a new channel started by a bunc... | 3640000 | 396066986 | 142 | False | UUPyFYlqbkxkWX_dWCg0eekA | https://en.wikipedia.org/wiki/Entertainment |
| 10 | UC5EQWvy59VeHPJz8mDALPxg | Mic Set | 2017-07-05T18:24:42Z | Micset is a full-service content creation comp... | 7670000 | 472480045 | 43 | False | UU5EQWvy59VeHPJz8mDALPxg | https://en.wikipedia.org/wiki/Film |
| 11 | UCY6KjrDBN_tIRFT_QNqQbRQ | Madan Gowri | 2013-12-05T15:57:57Z | MG Squad 🖖🏻 | 6590000 | 1455359659 | 2012 | False | UUY6KjrDBN_tIRFT_QNqQbRQ | https://en.wikipedia.org/wiki/Entertainment |
| 12 | UCueYcgdqos0_PzNOq81zAFg | Parithabangal | 2018-02-08T17:44:41Z | Welcome to Paridhabangal - your perfect fun st... | 4150000 | 660622676 | 308 | False | UUueYcgdqos0_PzNOq81zAFg | https://en.wikipedia.org/wiki/Entertainment |
| 13 | UClVIlK8QHZ2PFkXF97bA0lg | C4ETech English | 2007-03-20T15:48:43Z | Welcome to C4ETech, my name is Ash \n\nC4ETech... | 1810000 | 422763657 | 3114 | False | UUlVIlK8QHZ2PFkXF97bA0lg | https://en.wikipedia.org/wiki/Technology |
| 14 | UCHGktfcQq2BY_8tGPHwvm7g | Madras Samayal | 2015-12-08T01:23:39Z | Madras Samayal features traditional and modern... | 5580000 | 1318447313 | 663 | False | UUHGktfcQq2BY_8tGPHwvm7g | https://en.wikipedia.org/wiki/Food |
| 15 | UCsrYnyOJoaLIxCKTRWdy1Cg | How Hema | 2020-06-29T14:33:04.488044Z | HOW HEMA channel is dedicated to Vlogs, Review... | 666000 | 189043193 | 978 | False | UUsrYnyOJoaLIxCKTRWdy1Cg | https://en.wikipedia.org/wiki/Lifestyle_(socio... |
| 16 | UCzh5hQc_O3r3xjh9sXrM7-A | Black Sheep | 2016-02-29T18:22:03Z | Black Sheep is an infotainment channel which a... | 4540000 | 860521228 | 1227 | False | UUzh5hQc_O3r3xjh9sXrM7-A | https://en.wikipedia.org/wiki/Lifestyle_(socio... |
chanel.dtypes.values
array([dtype('O'), dtype('O'), dtype('O'), dtype('O'), dtype('O'),
dtype('O'), dtype('O'), dtype('bool'), dtype('O'), dtype('O')],
dtype=object)
chanel.rename(columns = {'title':'Channel_Name', 'subscriberCount':'Subscribers_Count',
'viewCount':'View_Count',"videoCount":"Total_videos"},inplace=True)
chanel[["Subscribers_Count","View_Count","Total_videos"]]=chanel[["Subscribers_Count","View_Count","Total_videos"]].apply(pd.to_numeric)
chanel.dtypes.values
array([dtype('O'), dtype('O'), dtype('O'), dtype('O'), dtype('int64'),
dtype('int64'), dtype('int64'), dtype('bool'), dtype('O'),
dtype('O')], dtype=object)
chanel.sort_values("Subscribers_Count",ascending=False).style.background_gradient(cmap="Reds")
| Channel_ID | Channel_Name | publishedAt | description | Subscribers_Count | View_Count | Total_videos | hiddenSubscriberCount | Playlist | Topic | |
|---|---|---|---|---|---|---|---|---|---|---|
| 4 | UCk3JZr7eS3pg5AGEvBdEvFg | Village Cooking Channel | 2018-04-25T16:38:11Z | Village grandpa cooking traditional village food, country foods, and tasty recipes for foodies, children, villagers, and poor people. Village cooking channel entertains you with cooking and sharing foods. | 19300000 | 4991717302 | 215 | False | UUk3JZr7eS3pg5AGEvBdEvFg | https://en.wikipedia.org/wiki/Food |
| 10 | UC5EQWvy59VeHPJz8mDALPxg | Mic Set | 2017-07-05T18:24:42Z | Micset is a full-service content creation company that believes in the power of humor which is the magic ingredient to our creations. We create content to tap the hearts and minds of every audience across the globe. Reviving your Life with a Smile in our own Style! For any business enquiries please contact - officialmicset@gmail.com & info@divo.in | 7670000 | 472480045 | 43 | False | UU5EQWvy59VeHPJz8mDALPxg | https://en.wikipedia.org/wiki/Film |
| 11 | UCY6KjrDBN_tIRFT_QNqQbRQ | Madan Gowri | 2013-12-05T15:57:57Z | MG Squad 🖖🏻 | 6590000 | 1455359659 | 2012 | False | UUY6KjrDBN_tIRFT_QNqQbRQ | https://en.wikipedia.org/wiki/Entertainment |
| 14 | UCHGktfcQq2BY_8tGPHwvm7g | Madras Samayal | 2015-12-08T01:23:39Z | Madras Samayal features traditional and modern recipes which were handed to me by my mother, mother in law and my grand-mother. Some of these recipes have been simplified to suit the modern cooking style while still retaining the traditional taste of Tamil Nadu Cuisine. This cuisine is very peculiar in the aspect that it stimulates the taste buds of all six tastes in every dish prepared and thus satisfying the palette thoroughly. Come on and learn the recipe of these tasty dishes. " Navin Suvai Arumbukkal Malarattum" | 5580000 | 1318447313 | 663 | False | UUHGktfcQq2BY_8tGPHwvm7g | https://en.wikipedia.org/wiki/Food |
| 3 | UCCEQKydMgEFIXA4XDshj0CA | Minutes Mystery | 2017-01-30T12:44:22Z | What a mysterious world we live in! The chattering sounds, million little miracles around us, inspiring stories make us pause even the world that's always on the move. Minutes Mystery is one such place that captures all attention. At Minutes Mystery, we'll share interesting facts, weird things worldwide, stories that tickle your funny bones, everyday motivation, and more. Join our channel, explore the mysteries of life, and stay amazed! For any business inquiries please contact - smbros139194@gmail.com ****************************************** | 4630000 | 289232410 | 271 | False | UUCEQKydMgEFIXA4XDshj0CA | https://en.wikipedia.org/wiki/Entertainment |
| 16 | UCzh5hQc_O3r3xjh9sXrM7-A | Black Sheep | 2016-02-29T18:22:03Z | Black Sheep is an infotainment channel which aims to engage an audience of all categories. Black Sheep wil be an upgraded version of Smile Mixture, this time aiming for more fun and entertainment. Watch, Share and Subscribe .... For Commercial Ads Contact : +91 93445 00795 Mail Id : advertise@blacksheepvalue.com | 4540000 | 860521228 | 1227 | False | UUzh5hQc_O3r3xjh9sXrM7-A | https://en.wikipedia.org/wiki/Lifestyle_(sociology) |
| 12 | UCueYcgdqos0_PzNOq81zAFg | Parithabangal | 2018-02-08T17:44:41Z | Welcome to Paridhabangal - your perfect fun stop with unlimited entertainment ranging from all age groups. Scroll down to watch our best comedy sketches that can bring you chuckles. All the funny videos are made to make you laugh, covering trending topics. Subscribe to our official channel and never miss watching our latest videos. ********************** Our Digital Partner - Divo Divo is one of the leading digital media companies in South India working with brands and content creators across genres. ********************** | 4150000 | 660622676 | 308 | False | UUueYcgdqos0_PzNOq81zAFg | https://en.wikipedia.org/wiki/Entertainment |
| 9 | UCPyFYlqbkxkWX_dWCg0eekA | Eruma Saani | 2017-04-25T13:38:26Z | Eruma Saani is a new channel started by a bunch of crazy shit shells. Please subscribe to our channel for crazy and enthusiastic content. For brand collaboration & advertising drop a mail to erumasaaniads@gmail.com | 3640000 | 396066986 | 142 | False | UUPyFYlqbkxkWX_dWCg0eekA | https://en.wikipedia.org/wiki/Entertainment |
| 5 | UC20sXo8ReewkzNKBFgzVCPA | TAMIL TECH - தமிழ் டெக் | 2016-02-13T18:45:14Z | Tamil Tech is 🌍Worlds "No #1" Top Technology channel (UNBIASED⚖️) in Tamil which Focuses on Quality 📱Tech Videos that make Sense. நம் தமிழ் மொழியில் ஒரு பெரிய வளமான டெக் குழுவிற்கு அன்புடன் வரவேற்கிறேன்💝. My name - Tamil Selvan (M.Tech - IT) 💻 Founder of Tamil Tech *Sponsors can contact me on below e-mail *** Business@TamilTechOfficial.com *** 📧 We don't provide any Tech Support via e_mail. Official website: http://tamiltechofficial.com/ THANK YOU ALL for your great support - நன்றி!! "வாழ்க தமிழ், வளர்க டெக்னாலஜி" Please find my other channel links below: ➡️Tamil Selvan : https://www.youtube.com/TamilSelvan ➡️Tech Thlaiva : https://www.youtube.com/TechThalaiva ➡️TamilTech SHORTS : https://bit.ly/TTShorts ➡️ HowiSiT : https://www.youtube.com/HowiSiTin Note: Copying or Reproduction of Logo or content from this channel is strictly prohibited. | 3590000 | 531296022 | 2366 | False | UU20sXo8ReewkzNKBFgzVCPA | https://en.wikipedia.org/wiki/Technology |
| 8 | UCnjU1FHmao9YNfPzE039YTw | Irfan's view | 2009-07-13T14:16:41Z | I love Food and Living. So, I vlog and do Food Reviews. | 3430000 | 863725902 | 1786 | False | UUnjU1FHmao9YNfPzE039YTw | https://en.wikipedia.org/wiki/Lifestyle_(sociology) |
| 13 | UClVIlK8QHZ2PFkXF97bA0lg | C4ETech English | 2007-03-20T15:48:43Z | Welcome to C4ETech, my name is Ash C4ETech is a tech channel that's focused on Smartphones and Android. Right from Reviews, Comparisons & Tests to App & Game recommendations to Mods and tutorials, I shoot a lot of videos... usually 20-30 a month. To stay updated on the latest in Android and possibly even learn something new go ahead and subscribe to C4ETech, its FREE :) Ash ►My Production Gear - http://amzn.to/1pTWUZ2 For Advertising/Sponsorship & other business related queries you can contact us at the e-mail address below... Please IGNORE e-mails sent to you from any non-"@c4etech" e-mail addresses! I DO NOT provide tech assistance via e-mail & any query sent to this ID will be ignored! | 1810000 | 422763657 | 3114 | False | UUlVIlK8QHZ2PFkXF97bA0lg | https://en.wikipedia.org/wiki/Technology |
| 2 | UC5cY198GU1MQMIPJgMkCJ_Q | Mr. GK | 2017-06-15T10:15:21Z | Please contact me thru my mail id given below. Our Shorts Channel: https://www.youtube.com/channel/UCGg6SROHmOtwEw4g4Ye15RA Follow us on my social media: Youtube: https://www.youtube.com/MrGKTamil Facebook: https://www.facebook.com/MrGKTamil Twitter: https://twitter.com/Mr_GK_Tamil Instagram: http://instagram.com/Mr_Gk_Tamil Telegram: https://t.me/MrGkGroup | 1180000 | 133701029 | 384 | False | UU5cY198GU1MQMIPJgMkCJ_Q | https://en.wikipedia.org/wiki/Knowledge |
| 1 | UC-jxPglhH5SGYlvRRanE_LA | Kanmani - Tamil Beauty Tips | 2018-05-06T16:00:16Z | 1100000 | 87293655 | 207 | False | UU-jxPglhH5SGYlvRRanE_LA | https://en.wikipedia.org/wiki/Lifestyle_(sociology) | |
| 15 | UCsrYnyOJoaLIxCKTRWdy1Cg | How Hema | 2020-06-29T14:33:04.488044Z | HOW HEMA channel is dedicated to Vlogs, Reviews, Life Style,Travel & Challenges. We cover variety of topics like shopping, business, adventure all in tamil language. I post videos "DAILY" I am just a human, I too like little encouragements & thanks in advance:) IF YOU ARE LIKE ME... THEN JOIN MY TRIBE #howhema by mashing the SUBSCRIBE button ~~~~~~~~~ Contact us on : contact.howhema@gmail.com 7418969596 (WhatsApp only) ~~~~~~~~~ if you want to FOLLOW MY PERSONAL VLOGS subscribe to #madrasjodi ~~~~~~~~~ About Me: Associated with NATURALS, GREEN TRENDS Certificated from STUDIO PROFILE, SCHWARZKOPF ACADEMY, LOREAL etc Had my own parlor for 7 Years @Chennai, Tamil Nadu 1 year experience in teaching at college level. Hi, I am Hema (M.Phil) I believe, one should always be curious to learn new things in very stages of life. I am passionate, curious and enthusiastic person open for learning. | 666000 | 189043193 | 978 | False | UUsrYnyOJoaLIxCKTRWdy1Cg | https://en.wikipedia.org/wiki/Lifestyle_(sociology) |
| 7 | UCCPWi_OwWMR5JTiujn7v-7g | Tamil Gaming தமிழ் கேமிங் | 2011-07-08T18:28:48Z | வணக்கம் இது தமிழ் கேமிங் நாங்கள் விவேக் மற்றும் பிரேம் Hi this is Tamil Gaming We are Vivek and Prem. we do Gameplay Commentary in Tamil Language. Subscribe to enjoy more Tamil Gaming Videos because Gaming sounds Good in Tamil TamilGaming youtube channel by Janu Vivek Prem | 419000 | 117129958 | 2020 | False | UUCPWi_OwWMR5JTiujn7v-7g | https://en.wikipedia.org/wiki/Action_game |
| 6 | UCyKYvZzVUnabf1F7RunRtoQ | Made By Mona | 2017-03-04T14:15:24Z | Follow your Heart...Follow your Passion...Do what makes you... Subscribe for more videos. | 372000 | 58587189 | 1109 | False | UUyKYvZzVUnabf1F7RunRtoQ | https://en.wikipedia.org/wiki/Lifestyle_(sociology) |
Village Cooking Channel has highest Subscribers_Count and and Viewing count.
chanel['Topic'].replace('https://en.wikipedia.org/wiki/','',regex=True,inplace=True)
chanel
| Channel_ID | Channel_Name | publishedAt | description | Subscribers_Count | View_Count | Total_videos | hiddenSubscriberCount | Playlist | Topic | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | UC-jxPglhH5SGYlvRRanE_LA | Kanmani - Tamil Beauty Tips | 2018-05-06T16:00:16Z | 1100000 | 87293655 | 207 | False | UU-jxPglhH5SGYlvRRanE_LA | Lifestyle_(sociology) | |
| 2 | UC5cY198GU1MQMIPJgMkCJ_Q | Mr. GK | 2017-06-15T10:15:21Z | Please contact me thru my mail id given below.... | 1180000 | 133701029 | 384 | False | UU5cY198GU1MQMIPJgMkCJ_Q | Knowledge |
| 3 | UCCEQKydMgEFIXA4XDshj0CA | Minutes Mystery | 2017-01-30T12:44:22Z | What a mysterious world we live in! The chatte... | 4630000 | 289232410 | 271 | False | UUCEQKydMgEFIXA4XDshj0CA | Entertainment |
| 4 | UCk3JZr7eS3pg5AGEvBdEvFg | Village Cooking Channel | 2018-04-25T16:38:11Z | Village grandpa cooking traditional village fo... | 19300000 | 4991717302 | 215 | False | UUk3JZr7eS3pg5AGEvBdEvFg | Food |
| 5 | UC20sXo8ReewkzNKBFgzVCPA | TAMIL TECH - தமிழ் டெக் | 2016-02-13T18:45:14Z | Tamil Tech is 🌍Worlds "No #1" Top Technology ... | 3590000 | 531296022 | 2366 | False | UU20sXo8ReewkzNKBFgzVCPA | Technology |
| 6 | UCyKYvZzVUnabf1F7RunRtoQ | Made By Mona | 2017-03-04T14:15:24Z | Follow your Heart...Follow your Passion...Do w... | 372000 | 58587189 | 1109 | False | UUyKYvZzVUnabf1F7RunRtoQ | Lifestyle_(sociology) |
| 7 | UCCPWi_OwWMR5JTiujn7v-7g | Tamil Gaming தமிழ் கேமிங் | 2011-07-08T18:28:48Z | வணக்கம் இது தமிழ் கேமிங் நாங்கள் விவேக் மற்றும... | 419000 | 117129958 | 2020 | False | UUCPWi_OwWMR5JTiujn7v-7g | Action_game |
| 8 | UCnjU1FHmao9YNfPzE039YTw | Irfan's view | 2009-07-13T14:16:41Z | I love Food and Living. So, I vlog and do Food... | 3430000 | 863725902 | 1786 | False | UUnjU1FHmao9YNfPzE039YTw | Lifestyle_(sociology) |
| 9 | UCPyFYlqbkxkWX_dWCg0eekA | Eruma Saani | 2017-04-25T13:38:26Z | Eruma Saani is a new channel started by a bunc... | 3640000 | 396066986 | 142 | False | UUPyFYlqbkxkWX_dWCg0eekA | Entertainment |
| 10 | UC5EQWvy59VeHPJz8mDALPxg | Mic Set | 2017-07-05T18:24:42Z | Micset is a full-service content creation comp... | 7670000 | 472480045 | 43 | False | UU5EQWvy59VeHPJz8mDALPxg | Film |
| 11 | UCY6KjrDBN_tIRFT_QNqQbRQ | Madan Gowri | 2013-12-05T15:57:57Z | MG Squad 🖖🏻 | 6590000 | 1455359659 | 2012 | False | UUY6KjrDBN_tIRFT_QNqQbRQ | Entertainment |
| 12 | UCueYcgdqos0_PzNOq81zAFg | Parithabangal | 2018-02-08T17:44:41Z | Welcome to Paridhabangal - your perfect fun st... | 4150000 | 660622676 | 308 | False | UUueYcgdqos0_PzNOq81zAFg | Entertainment |
| 13 | UClVIlK8QHZ2PFkXF97bA0lg | C4ETech English | 2007-03-20T15:48:43Z | Welcome to C4ETech, my name is Ash \n\nC4ETech... | 1810000 | 422763657 | 3114 | False | UUlVIlK8QHZ2PFkXF97bA0lg | Technology |
| 14 | UCHGktfcQq2BY_8tGPHwvm7g | Madras Samayal | 2015-12-08T01:23:39Z | Madras Samayal features traditional and modern... | 5580000 | 1318447313 | 663 | False | UUHGktfcQq2BY_8tGPHwvm7g | Food |
| 15 | UCsrYnyOJoaLIxCKTRWdy1Cg | How Hema | 2020-06-29T14:33:04.488044Z | HOW HEMA channel is dedicated to Vlogs, Review... | 666000 | 189043193 | 978 | False | UUsrYnyOJoaLIxCKTRWdy1Cg | Lifestyle_(sociology) |
| 16 | UCzh5hQc_O3r3xjh9sXrM7-A | Black Sheep | 2016-02-29T18:22:03Z | Black Sheep is an infotainment channel which a... | 4540000 | 860521228 | 1227 | False | UUzh5hQc_O3r3xjh9sXrM7-A | Lifestyle_(sociology) |
Poular topic
import plotly.express as px
px.scatter(chanel, x='Channel_Name', y='Subscribers_Count', size="Total_videos",size_max=40,
color='Topic')
px.scatter(chanel, x='Channel_Name', y='Subscribers_Count', size="View_Count",size_max=40,
color='Topic')
Most content created in Technology and Food is most viewed Content
fig = px.bar(chanel, x='Channel_Name', y='Subscribers_Count',color="Channel_Name")
fig.show()
Village Cooking Channel has large no of subscribers
fig = px.pie(chanel, values='Total_videos', names='Channel_Name', title='Video count')
fig.show()
C4ETech English posted highest no of videos among them
Is subscriber count relevent to Views?
import plotly.graph_objects as go
import plotly.express as px
fig = go.Figure(data=[go.Scatter(
x = chanel['Channel_Name'],
y = chanel['Subscribers_Count'],
stackgroup='one'),
go.Scatter(
x = chanel['Channel_Name'],
y = chanel['View_Count'],
stackgroup='one')
])
fig.show()
Let's see Who has most loyal subscribers
chanel["Loyalty"]=(chanel['View_Count']/chanel['Subscribers_Count'])
chanel.sort_values("Loyalty",ascending=False).style.background_gradient(cmap="Blues")
| Channel_ID | Channel_Name | publishedAt | description | Subscribers_Count | View_Count | Total_videos | hiddenSubscriberCount | Playlist | Topic | Loyalty | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | UCsrYnyOJoaLIxCKTRWdy1Cg | How Hema | 2020-06-29T14:33:04.488044Z | HOW HEMA channel is dedicated to Vlogs, Reviews, Life Style,Travel & Challenges. We cover variety of topics like shopping, business, adventure all in tamil language. I post videos "DAILY" I am just a human, I too like little encouragements & thanks in advance:) IF YOU ARE LIKE ME... THEN JOIN MY TRIBE #howhema by mashing the SUBSCRIBE button ~~~~~~~~~ Contact us on : contact.howhema@gmail.com 7418969596 (WhatsApp only) ~~~~~~~~~ if you want to FOLLOW MY PERSONAL VLOGS subscribe to #madrasjodi ~~~~~~~~~ About Me: Associated with NATURALS, GREEN TRENDS Certificated from STUDIO PROFILE, SCHWARZKOPF ACADEMY, LOREAL etc Had my own parlor for 7 Years @Chennai, Tamil Nadu 1 year experience in teaching at college level. Hi, I am Hema (M.Phil) I believe, one should always be curious to learn new things in very stages of life. I am passionate, curious and enthusiastic person open for learning. | 666000 | 189043193 | 978 | False | UUsrYnyOJoaLIxCKTRWdy1Cg | Lifestyle_(sociology) | 283.848638 |
| 7 | UCCPWi_OwWMR5JTiujn7v-7g | Tamil Gaming தமிழ் கேமிங் | 2011-07-08T18:28:48Z | வணக்கம் இது தமிழ் கேமிங் நாங்கள் விவேக் மற்றும் பிரேம் Hi this is Tamil Gaming We are Vivek and Prem. we do Gameplay Commentary in Tamil Language. Subscribe to enjoy more Tamil Gaming Videos because Gaming sounds Good in Tamil TamilGaming youtube channel by Janu Vivek Prem | 419000 | 117129958 | 2020 | False | UUCPWi_OwWMR5JTiujn7v-7g | Action_game | 279.546439 |
| 4 | UCk3JZr7eS3pg5AGEvBdEvFg | Village Cooking Channel | 2018-04-25T16:38:11Z | Village grandpa cooking traditional village food, country foods, and tasty recipes for foodies, children, villagers, and poor people. Village cooking channel entertains you with cooking and sharing foods. | 19300000 | 4991717302 | 215 | False | UUk3JZr7eS3pg5AGEvBdEvFg | Food | 258.638202 |
| 8 | UCnjU1FHmao9YNfPzE039YTw | Irfan's view | 2009-07-13T14:16:41Z | I love Food and Living. So, I vlog and do Food Reviews. | 3430000 | 863725902 | 1786 | False | UUnjU1FHmao9YNfPzE039YTw | Lifestyle_(sociology) | 251.815132 |
| 14 | UCHGktfcQq2BY_8tGPHwvm7g | Madras Samayal | 2015-12-08T01:23:39Z | Madras Samayal features traditional and modern recipes which were handed to me by my mother, mother in law and my grand-mother. Some of these recipes have been simplified to suit the modern cooking style while still retaining the traditional taste of Tamil Nadu Cuisine. This cuisine is very peculiar in the aspect that it stimulates the taste buds of all six tastes in every dish prepared and thus satisfying the palette thoroughly. Come on and learn the recipe of these tasty dishes. " Navin Suvai Arumbukkal Malarattum" | 5580000 | 1318447313 | 663 | False | UUHGktfcQq2BY_8tGPHwvm7g | Food | 236.280880 |
| 13 | UClVIlK8QHZ2PFkXF97bA0lg | C4ETech English | 2007-03-20T15:48:43Z | Welcome to C4ETech, my name is Ash C4ETech is a tech channel that's focused on Smartphones and Android. Right from Reviews, Comparisons & Tests to App & Game recommendations to Mods and tutorials, I shoot a lot of videos... usually 20-30 a month. To stay updated on the latest in Android and possibly even learn something new go ahead and subscribe to C4ETech, its FREE :) Ash ►My Production Gear - http://amzn.to/1pTWUZ2 For Advertising/Sponsorship & other business related queries you can contact us at the e-mail address below... Please IGNORE e-mails sent to you from any non-"@c4etech" e-mail addresses! I DO NOT provide tech assistance via e-mail & any query sent to this ID will be ignored! | 1810000 | 422763657 | 3114 | False | UUlVIlK8QHZ2PFkXF97bA0lg | Technology | 233.571081 |
| 11 | UCY6KjrDBN_tIRFT_QNqQbRQ | Madan Gowri | 2013-12-05T15:57:57Z | MG Squad 🖖🏻 | 6590000 | 1455359659 | 2012 | False | UUY6KjrDBN_tIRFT_QNqQbRQ | Entertainment | 220.843651 |
| 16 | UCzh5hQc_O3r3xjh9sXrM7-A | Black Sheep | 2016-02-29T18:22:03Z | Black Sheep is an infotainment channel which aims to engage an audience of all categories. Black Sheep wil be an upgraded version of Smile Mixture, this time aiming for more fun and entertainment. Watch, Share and Subscribe .... For Commercial Ads Contact : +91 93445 00795 Mail Id : advertise@blacksheepvalue.com | 4540000 | 860521228 | 1227 | False | UUzh5hQc_O3r3xjh9sXrM7-A | Lifestyle_(sociology) | 189.542121 |
| 12 | UCueYcgdqos0_PzNOq81zAFg | Parithabangal | 2018-02-08T17:44:41Z | Welcome to Paridhabangal - your perfect fun stop with unlimited entertainment ranging from all age groups. Scroll down to watch our best comedy sketches that can bring you chuckles. All the funny videos are made to make you laugh, covering trending topics. Subscribe to our official channel and never miss watching our latest videos. ********************** Our Digital Partner - Divo Divo is one of the leading digital media companies in South India working with brands and content creators across genres. ********************** | 4150000 | 660622676 | 308 | False | UUueYcgdqos0_PzNOq81zAFg | Entertainment | 159.186187 |
| 6 | UCyKYvZzVUnabf1F7RunRtoQ | Made By Mona | 2017-03-04T14:15:24Z | Follow your Heart...Follow your Passion...Do what makes you... Subscribe for more videos. | 372000 | 58587189 | 1109 | False | UUyKYvZzVUnabf1F7RunRtoQ | Lifestyle_(sociology) | 157.492444 |
| 5 | UC20sXo8ReewkzNKBFgzVCPA | TAMIL TECH - தமிழ் டெக் | 2016-02-13T18:45:14Z | Tamil Tech is 🌍Worlds "No #1" Top Technology channel (UNBIASED⚖️) in Tamil which Focuses on Quality 📱Tech Videos that make Sense. நம் தமிழ் மொழியில் ஒரு பெரிய வளமான டெக் குழுவிற்கு அன்புடன் வரவேற்கிறேன்💝. My name - Tamil Selvan (M.Tech - IT) 💻 Founder of Tamil Tech *Sponsors can contact me on below e-mail *** Business@TamilTechOfficial.com *** 📧 We don't provide any Tech Support via e_mail. Official website: http://tamiltechofficial.com/ THANK YOU ALL for your great support - நன்றி!! "வாழ்க தமிழ், வளர்க டெக்னாலஜி" Please find my other channel links below: ➡️Tamil Selvan : https://www.youtube.com/TamilSelvan ➡️Tech Thlaiva : https://www.youtube.com/TechThalaiva ➡️TamilTech SHORTS : https://bit.ly/TTShorts ➡️ HowiSiT : https://www.youtube.com/HowiSiTin Note: Copying or Reproduction of Logo or content from this channel is strictly prohibited. | 3590000 | 531296022 | 2366 | False | UU20sXo8ReewkzNKBFgzVCPA | Technology | 147.993321 |
| 2 | UC5cY198GU1MQMIPJgMkCJ_Q | Mr. GK | 2017-06-15T10:15:21Z | Please contact me thru my mail id given below. Our Shorts Channel: https://www.youtube.com/channel/UCGg6SROHmOtwEw4g4Ye15RA Follow us on my social media: Youtube: https://www.youtube.com/MrGKTamil Facebook: https://www.facebook.com/MrGKTamil Twitter: https://twitter.com/Mr_GK_Tamil Instagram: http://instagram.com/Mr_Gk_Tamil Telegram: https://t.me/MrGkGroup | 1180000 | 133701029 | 384 | False | UU5cY198GU1MQMIPJgMkCJ_Q | Knowledge | 113.305957 |
| 9 | UCPyFYlqbkxkWX_dWCg0eekA | Eruma Saani | 2017-04-25T13:38:26Z | Eruma Saani is a new channel started by a bunch of crazy shit shells. Please subscribe to our channel for crazy and enthusiastic content. For brand collaboration & advertising drop a mail to erumasaaniads@gmail.com | 3640000 | 396066986 | 142 | False | UUPyFYlqbkxkWX_dWCg0eekA | Entertainment | 108.809612 |
| 1 | UC-jxPglhH5SGYlvRRanE_LA | Kanmani - Tamil Beauty Tips | 2018-05-06T16:00:16Z | 1100000 | 87293655 | 207 | False | UU-jxPglhH5SGYlvRRanE_LA | Lifestyle_(sociology) | 79.357868 | |
| 3 | UCCEQKydMgEFIXA4XDshj0CA | Minutes Mystery | 2017-01-30T12:44:22Z | What a mysterious world we live in! The chattering sounds, million little miracles around us, inspiring stories make us pause even the world that's always on the move. Minutes Mystery is one such place that captures all attention. At Minutes Mystery, we'll share interesting facts, weird things worldwide, stories that tickle your funny bones, everyday motivation, and more. Join our channel, explore the mysteries of life, and stay amazed! For any business inquiries please contact - smbros139194@gmail.com ****************************************** | 4630000 | 289232410 | 271 | False | UUCEQKydMgEFIXA4XDshj0CA | Entertainment | 62.469203 |
| 10 | UC5EQWvy59VeHPJz8mDALPxg | Mic Set | 2017-07-05T18:24:42Z | Micset is a full-service content creation company that believes in the power of humor which is the magic ingredient to our creations. We create content to tap the hearts and minds of every audience across the globe. Reviving your Life with a Smile in our own Style! For any business enquiries please contact - officialmicset@gmail.com & info@divo.in | 7670000 | 472480045 | 43 | False | UU5EQWvy59VeHPJz8mDALPxg | Film | 61.601049 |
How Hema channel has highest subscriber views ratio. so that may be has most loyal subscribers.
pd.to_datetime(chanel["publishedAt"].max())+ pd.DateOffset(years=3)
Timestamp('2023-06-29 14:33:04.488044+0000', tz='UTC')
chanel["end"]=pd.to_datetime(chanel["publishedAt"].max())+ pd.DateOffset(years=3)
fig = px.timeline(chanel, x_start="publishedAt", x_end="end", y="Channel_Name",color="Subscribers_Count")
fig.show()
chanel.drop(["end"],axis=1)
| Channel_ID | Channel_Name | publishedAt | description | Subscribers_Count | View_Count | Total_videos | hiddenSubscriberCount | Playlist | Topic | Loyalty | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | UC-jxPglhH5SGYlvRRanE_LA | Kanmani - Tamil Beauty Tips | 2018-05-06T16:00:16Z | 1100000 | 87293655 | 207 | False | UU-jxPglhH5SGYlvRRanE_LA | Lifestyle_(sociology) | 79.357868 | |
| 2 | UC5cY198GU1MQMIPJgMkCJ_Q | Mr. GK | 2017-06-15T10:15:21Z | Please contact me thru my mail id given below.... | 1180000 | 133701029 | 384 | False | UU5cY198GU1MQMIPJgMkCJ_Q | Knowledge | 113.305957 |
| 3 | UCCEQKydMgEFIXA4XDshj0CA | Minutes Mystery | 2017-01-30T12:44:22Z | What a mysterious world we live in! The chatte... | 4630000 | 289232410 | 271 | False | UUCEQKydMgEFIXA4XDshj0CA | Entertainment | 62.469203 |
| 4 | UCk3JZr7eS3pg5AGEvBdEvFg | Village Cooking Channel | 2018-04-25T16:38:11Z | Village grandpa cooking traditional village fo... | 19300000 | 4991717302 | 215 | False | UUk3JZr7eS3pg5AGEvBdEvFg | Food | 258.638202 |
| 5 | UC20sXo8ReewkzNKBFgzVCPA | TAMIL TECH - தமிழ் டெக் | 2016-02-13T18:45:14Z | Tamil Tech is 🌍Worlds "No #1" Top Technology ... | 3590000 | 531296022 | 2366 | False | UU20sXo8ReewkzNKBFgzVCPA | Technology | 147.993321 |
| 6 | UCyKYvZzVUnabf1F7RunRtoQ | Made By Mona | 2017-03-04T14:15:24Z | Follow your Heart...Follow your Passion...Do w... | 372000 | 58587189 | 1109 | False | UUyKYvZzVUnabf1F7RunRtoQ | Lifestyle_(sociology) | 157.492444 |
| 7 | UCCPWi_OwWMR5JTiujn7v-7g | Tamil Gaming தமிழ் கேமிங் | 2011-07-08T18:28:48Z | வணக்கம் இது தமிழ் கேமிங் நாங்கள் விவேக் மற்றும... | 419000 | 117129958 | 2020 | False | UUCPWi_OwWMR5JTiujn7v-7g | Action_game | 279.546439 |
| 8 | UCnjU1FHmao9YNfPzE039YTw | Irfan's view | 2009-07-13T14:16:41Z | I love Food and Living. So, I vlog and do Food... | 3430000 | 863725902 | 1786 | False | UUnjU1FHmao9YNfPzE039YTw | Lifestyle_(sociology) | 251.815132 |
| 9 | UCPyFYlqbkxkWX_dWCg0eekA | Eruma Saani | 2017-04-25T13:38:26Z | Eruma Saani is a new channel started by a bunc... | 3640000 | 396066986 | 142 | False | UUPyFYlqbkxkWX_dWCg0eekA | Entertainment | 108.809612 |
| 10 | UC5EQWvy59VeHPJz8mDALPxg | Mic Set | 2017-07-05T18:24:42Z | Micset is a full-service content creation comp... | 7670000 | 472480045 | 43 | False | UU5EQWvy59VeHPJz8mDALPxg | Film | 61.601049 |
| 11 | UCY6KjrDBN_tIRFT_QNqQbRQ | Madan Gowri | 2013-12-05T15:57:57Z | MG Squad 🖖🏻 | 6590000 | 1455359659 | 2012 | False | UUY6KjrDBN_tIRFT_QNqQbRQ | Entertainment | 220.843651 |
| 12 | UCueYcgdqos0_PzNOq81zAFg | Parithabangal | 2018-02-08T17:44:41Z | Welcome to Paridhabangal - your perfect fun st... | 4150000 | 660622676 | 308 | False | UUueYcgdqos0_PzNOq81zAFg | Entertainment | 159.186187 |
| 13 | UClVIlK8QHZ2PFkXF97bA0lg | C4ETech English | 2007-03-20T15:48:43Z | Welcome to C4ETech, my name is Ash \n\nC4ETech... | 1810000 | 422763657 | 3114 | False | UUlVIlK8QHZ2PFkXF97bA0lg | Technology | 233.571081 |
| 14 | UCHGktfcQq2BY_8tGPHwvm7g | Madras Samayal | 2015-12-08T01:23:39Z | Madras Samayal features traditional and modern... | 5580000 | 1318447313 | 663 | False | UUHGktfcQq2BY_8tGPHwvm7g | Food | 236.280880 |
| 15 | UCsrYnyOJoaLIxCKTRWdy1Cg | How Hema | 2020-06-29T14:33:04.488044Z | HOW HEMA channel is dedicated to Vlogs, Review... | 666000 | 189043193 | 978 | False | UUsrYnyOJoaLIxCKTRWdy1Cg | Lifestyle_(sociology) | 283.848638 |
| 16 | UCzh5hQc_O3r3xjh9sXrM7-A | Black Sheep | 2016-02-29T18:22:03Z | Black Sheep is an infotainment channel which a... | 4540000 | 860521228 | 1227 | False | UUzh5hQc_O3r3xjh9sXrM7-A | Lifestyle_(sociology) | 189.542121 |
Chanel_ID=chanel["Playlist"]
Chanel_ID
1 UU-jxPglhH5SGYlvRRanE_LA 2 UU5cY198GU1MQMIPJgMkCJ_Q 3 UUCEQKydMgEFIXA4XDshj0CA 4 UUk3JZr7eS3pg5AGEvBdEvFg 5 UU20sXo8ReewkzNKBFgzVCPA 6 UUyKYvZzVUnabf1F7RunRtoQ 7 UUCPWi_OwWMR5JTiujn7v-7g 8 UUnjU1FHmao9YNfPzE039YTw 9 UUPyFYlqbkxkWX_dWCg0eekA 10 UU5EQWvy59VeHPJz8mDALPxg 11 UUY6KjrDBN_tIRFT_QNqQbRQ 12 UUueYcgdqos0_PzNOq81zAFg 13 UUlVIlK8QHZ2PFkXF97bA0lg 14 UUHGktfcQq2BY_8tGPHwvm7g 15 UUsrYnyOJoaLIxCKTRWdy1Cg 16 UUzh5hQc_O3r3xjh9sXrM7-A Name: Playlist, dtype: object
pi="UUY6KjrDBN_tIRFT_QNqQbRQ"
def Chanel_detail (youtube,pi):
playlist=[]
request = youtube.playlistItems().list(
part="snippet,contentDetails,id",
playlistId=pi,
maxResults = 50
#pageToken= next_page_token
)
response = request.execute()
for i in response["items"]:
playlist.append(i["contentDetails"]["videoId"])
next_page_token=response["nextPageToken"]
more_pages= True
while more_pages:
if next_page_token is None:
more_pages= False
else:
request = youtube.playlistItems().list(
part="snippet,contentDetails,id",
playlistId=pi,
maxResults = 50,
pageToken= next_page_token)
response = request.execute()
for i in response["items"]:
playlist.append(i["contentDetails"]["videoId"])
next_page_token=response.get("nextPageToken")
return (playlist)
playlist=Chanel_detail (youtube,pi)
len(playlist)
2011
def get_video_details(youtube,playlist): video_stats=[] for i in range (0,len(playlist),50): request = youtube.videos().list( part="snippet,statistics,contentDetails,topicDetails", id=",".join(playlist[i:i+50])) response = request.execute() for i in response["items"]: data={"snippet":["title","publishedAt","description"], "statistics":["viewCount","likeCount","commentCount"], "contentDetails":["duration"] } v_data={} v_data["Tittle"]=i["snippet"]["title"] v_data["Published date"]=i["snippet"]["publishedAt"]
for i in response["items"]:
v_data={"Tittle":i["snippet"]["title"],
"Published date":i["snippet"]["publishedAt"],
"Views":i["statistics"]["viewCount"],
"likes":i["statistics"]["likeCount"],
"Duration":i["contentDetails"]["duration"],
}
video_stats.append(v_data)
return(video_stats)
def get_video_details(youtube,playlist):
video_stats=[]
for i in range (0,len(playlist),50):
request = youtube.videos().list(
part="snippet,statistics,contentDetails,topicDetails",
id=",".join(playlist[i:i+50]))
response = request.execute()
for i in response["items"]:
data={
"statistics":["viewCount","likeCount","commentCount"],
}
v_data={}
v_data["Title"]=i["snippet"]["title"]
v_data["Published_date"]=i["snippet"]["publishedAt"]
for x in data.keys():
for y in data[x]:
try:
v_data[y]=i[x][y]
except:
v_data[y]=None
v_data["Duration"]=i["contentDetails"]["duration"]
video_stats.append(v_data)
return(video_stats)
MG_videos=get_video_details(youtube,playlist)
MG=pd.DataFrame(MG_videos)
MG
| Title | Published_date | viewCount | likeCount | commentCount | Duration | |
|---|---|---|---|---|---|---|
| 0 | 🏭 Factory Made Babies 👶 | Madan Gowri | #shorts | 2022-12-25T14:33:39Z | 162391 | 26866 | 483 | PT1M |
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430 | PT11M8S |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159 | PT12M1S |
| 3 | Surprise Gift! | Madan Gowri | #shorts | 2022-12-23T15:41:26Z | 182361 | 22199 | 227 | PT53S |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960 | PT13M34S |
| ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156 | PT2M36S |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551 | PT8M1S |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216 | PT2M39S |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390 | PT7M2S |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738 | PT1M40S |
2011 rows × 6 columns
Let's see data types of each column
MG.dtypes
Title object Published_date object viewCount object likeCount object commentCount object Duration object dtype: object
MG[["viewCount","likeCount","commentCount"]]=MG[["viewCount","likeCount","commentCount"]].apply(pd.to_numeric)
MG
| Title | Published_date | viewCount | likeCount | commentCount | Duration | |
|---|---|---|---|---|---|---|
| 0 | 🏭 Factory Made Babies 👶 | Madan Gowri | #shorts | 2022-12-25T14:33:39Z | 162391 | 26866 | 483.0 | PT1M |
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | PT11M8S |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | PT12M1S |
| 3 | Surprise Gift! | Madan Gowri | #shorts | 2022-12-23T15:41:26Z | 182361 | 22199 | 227.0 | PT53S |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | PT13M34S |
| ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | PT2M36S |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | PT8M1S |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | PT2M39S |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | PT7M2S |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | PT1M40S |
2011 rows × 6 columns
MG.dtypes
Title object Published_date object viewCount int64 likeCount int64 commentCount float64 Duration object dtype: object
lets Find Duration of Each Videos
temp=MG.copy()
temp
| Title | Published_date | viewCount | likeCount | commentCount | Duration | |
|---|---|---|---|---|---|---|
| 0 | 🏭 Factory Made Babies 👶 | Madan Gowri | #shorts | 2022-12-25T14:33:39Z | 162391 | 26866 | 483.0 | PT1M |
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | PT11M8S |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | PT12M1S |
| 3 | Surprise Gift! | Madan Gowri | #shorts | 2022-12-23T15:41:26Z | 182361 | 22199 | 227.0 | PT53S |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | PT13M34S |
| ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | PT2M36S |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | PT8M1S |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | PT2M39S |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | PT7M2S |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | PT1M40S |
2011 rows × 6 columns
MG1=MG.copy()
MG1
| Title | Published_date | viewCount | likeCount | commentCount | Duration | |
|---|---|---|---|---|---|---|
| 0 | 🏭 Factory Made Babies 👶 | Madan Gowri | #shorts | 2022-12-25T14:33:39Z | 162391 | 26866 | 483.0 | PT1M |
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | PT11M8S |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | PT12M1S |
| 3 | Surprise Gift! | Madan Gowri | #shorts | 2022-12-23T15:41:26Z | 182361 | 22199 | 227.0 | PT53S |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | PT13M34S |
| ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | PT2M36S |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | PT8M1S |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | PT2M39S |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | PT7M2S |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | PT1M40S |
2011 rows × 6 columns
MG['Duration'].replace('PT','',regex=True,inplace=True)
MG
| Title | Published_date | viewCount | likeCount | commentCount | Duration | |
|---|---|---|---|---|---|---|
| 0 | 🏭 Factory Made Babies 👶 | Madan Gowri | #shorts | 2022-12-25T14:33:39Z | 162391 | 26866 | 483.0 | 1M |
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | 11M8S |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | 12M1S |
| 3 | Surprise Gift! | Madan Gowri | #shorts | 2022-12-23T15:41:26Z | 182361 | 22199 | 227.0 | 53S |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | 13M34S |
| ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | 2M36S |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | 8M1S |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | 2M39S |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | 7M2S |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | 1M40S |
2011 rows × 6 columns
Seperate Shots into Different dataframe
#Shorts and reindexing
MG_Shots = MG[~MG["Duration"].str.contains('M')]
MG_Shots
| Title | Published_date | viewCount | likeCount | commentCount | Duration | |
|---|---|---|---|---|---|---|
| 3 | Surprise Gift! | Madan Gowri | #shorts | 2022-12-23T15:41:26Z | 182361 | 22199 | 227.0 | 53S |
| 5 | Why Hole in Flight Window?! | Madan Gowri | #s... | 2022-12-22T11:59:13Z | 958787 | 101666 | 316.0 | 55S |
| 8 | Body 😳 in Moon 🌕 | Madan Gowri | #shorts | 2022-12-20T05:41:42Z | 431277 | 57322 | 112.0 | 55S |
| 10 | Sundar Pichai X Madan Gowri 🔥 #shorts | 2022-12-19T10:12:16Z | 1238701 | 109918 | 540.0 | 10S |
| 11 | MG Squad Forever 🖖🏻 💥 | 2022-12-18T12:42:46Z | 276434 | 24392 | 103.0 | 17S |
| ... | ... | ... | ... | ... | ... | ... |
| 510 | EX LOVE SONG TEASER | Madan Gowri X Atti Culture | 2021-09-15T15:29:58Z | 895666 | 85972 | 6241.0 | 36S |
| 560 | 8:30-ku Bathroom Song Coming.... | Madan Gowri... | 2021-07-28T07:54:22Z | 759275 | 71657 | 7180.0 | 41S |
| 875 | Join MG SQUAD | Madan Gowri | 2020-09-16T08:29:25Z | 1185426 | 106187 | 2890.0 | 43S |
| 908 | Madan Gowri Live Stream | 2020-08-15T06:00:40Z | 0 | 6 | 0.0 | P0D |
| 1697 | Yanny or Laurel | 2018-05-18T07:50:28Z | 444486 | 13240 | 3752.0 | 11S |
70 rows × 6 columns
MG_Vid= MG[MG["Duration"].str.contains('M')]
Index=np.arange(1,(len(MG_Vid["Title"]))+1)
MG_Vid.reset_index(drop=True)
MG_Vid.set_index(Index)
| Title | Published_date | viewCount | likeCount | commentCount | Duration | |
|---|---|---|---|---|---|---|
| 1 | 🏭 Factory Made Babies 👶 | Madan Gowri | #shorts | 2022-12-25T14:33:39Z | 162391 | 26866 | 483.0 | 1M |
| 2 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | 11M8S |
| 3 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | 12M1S |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | 13M34S |
| 5 | Virus Entered India | Tamil News | Madan Gowri... | 2022-12-21T16:51:08Z | 916723 | 31574 | 3280.0 | 13M32S |
| ... | ... | ... | ... | ... | ... | ... |
| 1937 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | 2M36S |
| 1938 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | 8M1S |
| 1939 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | 2M39S |
| 1940 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | 7M2S |
| 1941 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | 1M40S |
1941 rows × 6 columns
MG_Vid[MG_Vid["Title"].str.contains('#shorts')]
| Title | Published_date | viewCount | likeCount | commentCount | Duration | |
|---|---|---|---|---|---|---|
| 0 | 🏭 Factory Made Babies 👶 | Madan Gowri | #shorts | 2022-12-25T14:33:39Z | 162391 | 26866 | 483.0 | 1M |
Lets add this into shorts dataset
r=MG_Vid[MG_Vid["Title"].str.contains('#shorts')]
MG_Shots=MG_Shots.append(r,ignore_index=True)
MG_Shots
| Title | Published_date | viewCount | likeCount | commentCount | Duration | |
|---|---|---|---|---|---|---|
| 0 | Surprise Gift! | Madan Gowri | #shorts | 2022-12-23T15:41:26Z | 182361 | 22199 | 227.0 | 53S |
| 1 | Why Hole in Flight Window?! | Madan Gowri | #s... | 2022-12-22T11:59:13Z | 958787 | 101666 | 316.0 | 55S |
| 2 | Body 😳 in Moon 🌕 | Madan Gowri | #shorts | 2022-12-20T05:41:42Z | 431277 | 57322 | 112.0 | 55S |
| 3 | Sundar Pichai X Madan Gowri 🔥 #shorts | 2022-12-19T10:12:16Z | 1238701 | 109918 | 540.0 | 10S |
| 4 | MG Squad Forever 🖖🏻 💥 | 2022-12-18T12:42:46Z | 276434 | 24392 | 103.0 | 17S |
| ... | ... | ... | ... | ... | ... | ... |
| 66 | 8:30-ku Bathroom Song Coming.... | Madan Gowri... | 2021-07-28T07:54:22Z | 759275 | 71657 | 7180.0 | 41S |
| 67 | Join MG SQUAD | Madan Gowri | 2020-09-16T08:29:25Z | 1185426 | 106187 | 2890.0 | 43S |
| 68 | Madan Gowri Live Stream | 2020-08-15T06:00:40Z | 0 | 6 | 0.0 | P0D |
| 69 | Yanny or Laurel | 2018-05-18T07:50:28Z | 444486 | 13240 | 3752.0 | 11S |
| 70 | 🏭 Factory Made Babies 👶 | Madan Gowri | #shorts | 2022-12-25T14:33:39Z | 162391 | 26866 | 483.0 | 1M |
71 rows × 6 columns
#reindexing
I=np.arange(1,(len(MG_Shots["Title"]))+1)
MG_Shots.reset_index(drop=True)
MG_Shots.set_index(I)
| Title | Published_date | viewCount | likeCount | commentCount | Duration | |
|---|---|---|---|---|---|---|
| 1 | Surprise Gift! | Madan Gowri | #shorts | 2022-12-23T15:41:26Z | 182361 | 22199 | 227.0 | 53S |
| 2 | Why Hole in Flight Window?! | Madan Gowri | #s... | 2022-12-22T11:59:13Z | 958787 | 101666 | 316.0 | 55S |
| 3 | Body 😳 in Moon 🌕 | Madan Gowri | #shorts | 2022-12-20T05:41:42Z | 431277 | 57322 | 112.0 | 55S |
| 4 | Sundar Pichai X Madan Gowri 🔥 #shorts | 2022-12-19T10:12:16Z | 1238701 | 109918 | 540.0 | 10S |
| 5 | MG Squad Forever 🖖🏻 💥 | 2022-12-18T12:42:46Z | 276434 | 24392 | 103.0 | 17S |
| ... | ... | ... | ... | ... | ... | ... |
| 67 | 8:30-ku Bathroom Song Coming.... | Madan Gowri... | 2021-07-28T07:54:22Z | 759275 | 71657 | 7180.0 | 41S |
| 68 | Join MG SQUAD | Madan Gowri | 2020-09-16T08:29:25Z | 1185426 | 106187 | 2890.0 | 43S |
| 69 | Madan Gowri Live Stream | 2020-08-15T06:00:40Z | 0 | 6 | 0.0 | P0D |
| 70 | Yanny or Laurel | 2018-05-18T07:50:28Z | 444486 | 13240 | 3752.0 | 11S |
| 71 | 🏭 Factory Made Babies 👶 | Madan Gowri | #shorts | 2022-12-25T14:33:39Z | 162391 | 26866 | 483.0 | 1M |
71 rows × 6 columns
totally there is 71 shorts now far📜
MG_Vid.drop([0],inplace=True,axis=0)
MG_Vid
C:\Users\deepi\anaconda3\lib\site-packages\pandas\core\frame.py:4906: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
| Title | Published_date | viewCount | likeCount | commentCount | Duration | |
|---|---|---|---|---|---|---|
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | 11M8S |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | 12M1S |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | 13M34S |
| 6 | Virus Entered India | Tamil News | Madan Gowri... | 2022-12-21T16:51:08Z | 916723 | 31574 | 3280.0 | 13M32S |
| 7 | 2023 - Full Lockdown - New Variant China | Tam... | 2022-12-20T14:18:15Z | 1242150 | 38407 | 2892.0 | 13M56S |
| ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | 2M36S |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | 8M1S |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | 2M39S |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | 7M2S |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | 1M40S |
1940 rows × 6 columns
Time to save 🔥
MG.to_csv("Madhan_gowri_Youtube_All_videos.csv")
MG_Shots.to_csv("Madhan_gowri_Youtube_shots.csv")
MG_Vid.to_csv("Madhan_gowri_Youtube_videos.csv")
Let's format duration 😈
MG_Vid1=MG_Vid.copy()
MG_Vid1
| Title | Published_date | viewCount | likeCount | commentCount | Duration | |
|---|---|---|---|---|---|---|
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | 11M8S |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | 12M1S |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | 13M34S |
| 6 | Virus Entered India | Tamil News | Madan Gowri... | 2022-12-21T16:51:08Z | 916723 | 31574 | 3280.0 | 13M32S |
| 7 | 2023 - Full Lockdown - New Variant China | Tam... | 2022-12-20T14:18:15Z | 1242150 | 38407 | 2892.0 | 13M56S |
| ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | 2M36S |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | 8M1S |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | 2M39S |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | 7M2S |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | 1M40S |
1940 rows × 6 columns
Lets convert time to Seconds first
MG_Vid1[["Minutes","Sec"]]= MG_Vid1["Duration"].str.split("M",1, expand=True)
MG_Vid1
| Title | Published_date | viewCount | likeCount | commentCount | Duration | Minutes | Sec | |
|---|---|---|---|---|---|---|---|---|
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | 11M8S | 11 | 8S |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | 12M1S | 12 | 1S |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | 13M34S | 13 | 34S |
| 6 | Virus Entered India | Tamil News | Madan Gowri... | 2022-12-21T16:51:08Z | 916723 | 31574 | 3280.0 | 13M32S | 13 | 32S |
| 7 | 2023 - Full Lockdown - New Variant China | Tam... | 2022-12-20T14:18:15Z | 1242150 | 38407 | 2892.0 | 13M56S | 13 | 56S |
| ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | 2M36S | 2 | 36S |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | 8M1S | 8 | 1S |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | 2M39S | 2 | 39S |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | 7M2S | 7 | 2S |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | 1M40S | 1 | 40S |
1940 rows × 8 columns
MG_Vid1['Sec'].replace('S','',regex=True,inplace=True)
MG_Vid1
| Title | Published_date | viewCount | likeCount | commentCount | Duration | Minutes | Sec | |
|---|---|---|---|---|---|---|---|---|
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | 11M8S | 11 | 8 |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | 12M1S | 12 | 1 |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | 13M34S | 13 | 34 |
| 6 | Virus Entered India | Tamil News | Madan Gowri... | 2022-12-21T16:51:08Z | 916723 | 31574 | 3280.0 | 13M32S | 13 | 32 |
| 7 | 2023 - Full Lockdown - New Variant China | Tam... | 2022-12-20T14:18:15Z | 1242150 | 38407 | 2892.0 | 13M56S | 13 | 56 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | 2M36S | 2 | 36 |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | 8M1S | 8 | 1 |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | 2M39S | 2 | 39 |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | 7M2S | 7 | 2 |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | 1M40S | 1 | 40 |
1940 rows × 8 columns
Lets Change Minutes & Sec datatypes to int
MG_Vid1.dtypes
Title object Published_date object viewCount int64 likeCount int64 commentCount float64 Duration object Minutes object Sec object dtype: object
MG_Vid1[["Sec","Minutes",]]=MG_Vid1[["Sec","Minutes",]].apply(pd.to_numeric)
MG_Vid1.dtypes
Title object Published_date object viewCount int64 likeCount int64 commentCount float64 Duration object Minutes int64 Sec float64 dtype: object
MG_Vid1["Minutes"]=MG_Vid1["Minutes"]*60
MG_Vid1
| Title | Published_date | viewCount | likeCount | commentCount | Duration | Minutes | Sec | |
|---|---|---|---|---|---|---|---|---|
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | 11M8S | 660 | 8.0 |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | 12M1S | 720 | 1.0 |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | 13M34S | 780 | 34.0 |
| 6 | Virus Entered India | Tamil News | Madan Gowri... | 2022-12-21T16:51:08Z | 916723 | 31574 | 3280.0 | 13M32S | 780 | 32.0 |
| 7 | 2023 - Full Lockdown - New Variant China | Tam... | 2022-12-20T14:18:15Z | 1242150 | 38407 | 2892.0 | 13M56S | 780 | 56.0 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | 2M36S | 120 | 36.0 |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | 8M1S | 480 | 1.0 |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | 2M39S | 120 | 39.0 |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | 7M2S | 420 | 2.0 |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | 1M40S | 60 | 40.0 |
1940 rows × 8 columns
MG_Vid1["Duration_Time_Sec"]=MG_Vid1["Minutes"]+MG_Vid1["Sec"]
MG_Vid1
| Title | Published_date | viewCount | likeCount | commentCount | Duration | Minutes | Sec | Duration_Time_Sec | |
|---|---|---|---|---|---|---|---|---|---|
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | 11M8S | 660 | 8.0 | 668.0 |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | 12M1S | 720 | 1.0 | 721.0 |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | 13M34S | 780 | 34.0 | 814.0 |
| 6 | Virus Entered India | Tamil News | Madan Gowri... | 2022-12-21T16:51:08Z | 916723 | 31574 | 3280.0 | 13M32S | 780 | 32.0 | 812.0 |
| 7 | 2023 - Full Lockdown - New Variant China | Tam... | 2022-12-20T14:18:15Z | 1242150 | 38407 | 2892.0 | 13M56S | 780 | 56.0 | 836.0 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | 2M36S | 120 | 36.0 | 156.0 |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | 8M1S | 480 | 1.0 | 481.0 |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | 2M39S | 120 | 39.0 | 159.0 |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | 7M2S | 420 | 2.0 | 422.0 |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | 1M40S | 60 | 40.0 | 100.0 |
1940 rows × 9 columns
#MG_Vid1["Duration_Time"]=MG_Vid1["Duration_Time_Sec"].round().apply(pd.to_timedelta, unit='s')
MG_Vid1["Duration_Time"] = pd.to_datetime(MG_Vid1["Duration_Time_Sec"], unit='s').dt.strftime("%M:%S")
MG_Vid1
| Title | Published_date | viewCount | likeCount | commentCount | Duration | Minutes | Sec | Duration_Time_Sec | Duration_Time | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | 11M8S | 660 | 8.0 | 668.0 | 11:08 |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | 12M1S | 720 | 1.0 | 721.0 | 12:01 |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | 13M34S | 780 | 34.0 | 814.0 | 13:34 |
| 6 | Virus Entered India | Tamil News | Madan Gowri... | 2022-12-21T16:51:08Z | 916723 | 31574 | 3280.0 | 13M32S | 780 | 32.0 | 812.0 | 13:32 |
| 7 | 2023 - Full Lockdown - New Variant China | Tam... | 2022-12-20T14:18:15Z | 1242150 | 38407 | 2892.0 | 13M56S | 780 | 56.0 | 836.0 | 13:56 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | 2M36S | 120 | 36.0 | 156.0 | 02:36 |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | 8M1S | 480 | 1.0 | 481.0 | 08:01 |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | 2M39S | 120 | 39.0 | 159.0 | 02:39 |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | 7M2S | 420 | 2.0 | 422.0 | 07:02 |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | 1M40S | 60 | 40.0 | 100.0 | 01:40 |
1940 rows × 10 columns
MG_Vid1.drop(["Minutes","Sec"],axis=1,inplace=True)
MG_Vid1
| Title | Published_date | viewCount | likeCount | commentCount | Duration | Duration_Time_Sec | Duration_Time | |
|---|---|---|---|---|---|---|---|---|
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | 11M8S | 668.0 | 11:08 |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | 12M1S | 721.0 | 12:01 |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | 13M34S | 814.0 | 13:34 |
| 6 | Virus Entered India | Tamil News | Madan Gowri... | 2022-12-21T16:51:08Z | 916723 | 31574 | 3280.0 | 13M32S | 812.0 | 13:32 |
| 7 | 2023 - Full Lockdown - New Variant China | Tam... | 2022-12-20T14:18:15Z | 1242150 | 38407 | 2892.0 | 13M56S | 836.0 | 13:56 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | 2M36S | 156.0 | 02:36 |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | 8M1S | 481.0 | 08:01 |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | 2M39S | 159.0 | 02:39 |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | 7M2S | 422.0 | 07:02 |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | 1M40S | 100.0 | 01:40 |
1940 rows × 8 columns
MG_Vid1[["Posted_Date","Posted_time"]]=MG_Vid1["Published_date"].str.split("T",1, expand=True)
MG_Vid1
| Title | Published_date | viewCount | likeCount | commentCount | Duration | Duration_Time_Sec | Duration_Time | Posted_Date | Posted_time | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | 11M8S | 668.0 | 11:08 | 2022-12-24 | 17:19:12Z |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | 12M1S | 721.0 | 12:01 | 2022-12-23 | 17:21:56Z |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | 13M34S | 814.0 | 13:34 | 2022-12-22 | 16:24:08Z |
| 6 | Virus Entered India | Tamil News | Madan Gowri... | 2022-12-21T16:51:08Z | 916723 | 31574 | 3280.0 | 13M32S | 812.0 | 13:32 | 2022-12-21 | 16:51:08Z |
| 7 | 2023 - Full Lockdown - New Variant China | Tam... | 2022-12-20T14:18:15Z | 1242150 | 38407 | 2892.0 | 13M56S | 836.0 | 13:56 | 2022-12-20 | 14:18:15Z |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | 2M36S | 156.0 | 02:36 | 2016-09-15 | 15:03:53Z |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | 8M1S | 481.0 | 08:01 | 2016-09-04 | 21:55:43Z |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | 2M39S | 159.0 | 02:39 | 2016-08-14 | 06:04:23Z |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | 7M2S | 422.0 | 07:02 | 2016-07-03 | 09:30:45Z |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | 1M40S | 100.0 | 01:40 | 2016-03-22 | 20:03:59Z |
1940 rows × 10 columns
#datetime conversion
MG_Vid1["Posted_Date_datetype"] = pd.to_datetime(MG_Vid1["Posted_Date"])
MG_Vid1
| Title | Published_date | viewCount | likeCount | commentCount | Duration | Duration_Time_Sec | Duration_Time | Posted_Date | Posted_time | Posted_Date_datetype | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | 11M8S | 668.0 | 11:08 | 2022-12-24 | 17:19:12Z | 2022-12-24 |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | 12M1S | 721.0 | 12:01 | 2022-12-23 | 17:21:56Z | 2022-12-23 |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | 13M34S | 814.0 | 13:34 | 2022-12-22 | 16:24:08Z | 2022-12-22 |
| 6 | Virus Entered India | Tamil News | Madan Gowri... | 2022-12-21T16:51:08Z | 916723 | 31574 | 3280.0 | 13M32S | 812.0 | 13:32 | 2022-12-21 | 16:51:08Z | 2022-12-21 |
| 7 | 2023 - Full Lockdown - New Variant China | Tam... | 2022-12-20T14:18:15Z | 1242150 | 38407 | 2892.0 | 13M56S | 836.0 | 13:56 | 2022-12-20 | 14:18:15Z | 2022-12-20 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | 2M36S | 156.0 | 02:36 | 2016-09-15 | 15:03:53Z | 2016-09-15 |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | 8M1S | 481.0 | 08:01 | 2016-09-04 | 21:55:43Z | 2016-09-04 |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | 2M39S | 159.0 | 02:39 | 2016-08-14 | 06:04:23Z | 2016-08-14 |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | 7M2S | 422.0 | 07:02 | 2016-07-03 | 09:30:45Z | 2016-07-03 |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | 1M40S | 100.0 | 01:40 | 2016-03-22 | 20:03:59Z | 2016-03-22 |
1940 rows × 11 columns
MG_Vid1["Posted_year"]=MG_Vid1["Posted_Date_datetype"].dt.year
MG_Vid1
| Title | Published_date | viewCount | likeCount | commentCount | Duration | Duration_Time_Sec | Duration_Time | Posted_Date | Posted_time | Posted_Date_datetype | Posted_year | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | 11M8S | 668.0 | 11:08 | 2022-12-24 | 17:19:12Z | 2022-12-24 | 2022 |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | 12M1S | 721.0 | 12:01 | 2022-12-23 | 17:21:56Z | 2022-12-23 | 2022 |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | 13M34S | 814.0 | 13:34 | 2022-12-22 | 16:24:08Z | 2022-12-22 | 2022 |
| 6 | Virus Entered India | Tamil News | Madan Gowri... | 2022-12-21T16:51:08Z | 916723 | 31574 | 3280.0 | 13M32S | 812.0 | 13:32 | 2022-12-21 | 16:51:08Z | 2022-12-21 | 2022 |
| 7 | 2023 - Full Lockdown - New Variant China | Tam... | 2022-12-20T14:18:15Z | 1242150 | 38407 | 2892.0 | 13M56S | 836.0 | 13:56 | 2022-12-20 | 14:18:15Z | 2022-12-20 | 2022 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | 2M36S | 156.0 | 02:36 | 2016-09-15 | 15:03:53Z | 2016-09-15 | 2016 |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | 8M1S | 481.0 | 08:01 | 2016-09-04 | 21:55:43Z | 2016-09-04 | 2016 |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | 2M39S | 159.0 | 02:39 | 2016-08-14 | 06:04:23Z | 2016-08-14 | 2016 |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | 7M2S | 422.0 | 07:02 | 2016-07-03 | 09:30:45Z | 2016-07-03 | 2016 |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | 1M40S | 100.0 | 01:40 | 2016-03-22 | 20:03:59Z | 2016-03-22 | 2016 |
1940 rows × 12 columns
MG_Vid1["Posted_month"]=MG_Vid1["Posted_Date_datetype"].dt.month
MG_Vid1
| Title | Published_date | viewCount | likeCount | commentCount | Duration | Duration_Time_Sec | Duration_Time | Posted_Date | Posted_time | Posted_Date_datetype | Posted_year | Posted_month | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | China Blood Shortage | Tamil | Madan Gowri | MG | 2022-12-24T17:19:12Z | 614937 | 21886 | 1430.0 | 11M8S | 668.0 | 11:08 | 2022-12-24 | 17:19:12Z | 2022-12-24 | 2022 | 12 |
| 2 | 3 Crore Cases in 1 Day | Tamil News | Madan Go... | 2022-12-23T17:21:56Z | 938683 | 32102 | 2159.0 | 12M1S | 721.0 | 12:01 | 2022-12-23 | 17:21:56Z | 2022-12-23 | 2022 | 12 |
| 4 | New Rules for India?! | Tamil | Madan Gowri | MG | 2022-12-22T16:24:08Z | 904581 | 28823 | 1960.0 | 13M34S | 814.0 | 13:34 | 2022-12-22 | 16:24:08Z | 2022-12-22 | 2022 | 12 |
| 6 | Virus Entered India | Tamil News | Madan Gowri... | 2022-12-21T16:51:08Z | 916723 | 31574 | 3280.0 | 13M32S | 812.0 | 13:32 | 2022-12-21 | 16:51:08Z | 2022-12-21 | 2022 | 12 |
| 7 | 2023 - Full Lockdown - New Variant China | Tam... | 2022-12-20T14:18:15Z | 1242150 | 38407 | 2892.0 | 13M56S | 836.0 | 13:56 | 2022-12-20 | 14:18:15Z | 2022-12-20 | 2022 | 12 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2006 | Jio Story | Tamil | Madan Gowri | MG | 2016-09-15T15:03:53Z | 67961 | 2166 | 156.0 | 2M36S | 156.0 | 02:36 | 2016-09-15 | 15:03:53Z | 2016-09-15 | 2016 | 9 |
| 2007 | Jio Business explained | Tamil | Madan Gowri | MG | 2016-09-04T21:55:43Z | 198272 | 7496 | 551.0 | 8M1S | 481.0 | 08:01 | 2016-09-04 | 21:55:43Z | 2016-09-04 | 2016 | 9 |
| 2008 | Pakistan Independence day | Madan Gowri | MG | 2016-08-14T06:04:23Z | 141372 | 4993 | 216.0 | 2M39S | 159.0 | 02:39 | 2016-08-14 | 06:04:23Z | 2016-08-14 | 2016 | 8 |
| 2009 | Fight for her | Madan Gowri | MG | 2016-07-03T09:30:45Z | 405765 | 19315 | 1390.0 | 7M2S | 422.0 | 07:02 | 2016-07-03 | 09:30:45Z | 2016-07-03 | 2016 | 7 |
| 2010 | Stop letting misunderstandings ruin your relat... | 2016-03-22T20:03:59Z | 1072166 | 75323 | 8738.0 | 1M40S | 100.0 | 01:40 | 2016-03-22 | 20:03:59Z | 2016-03-22 | 2016 | 3 |
1940 rows × 13 columns
Now we have published date, Duration at datetime format. And we have extracted published year from Date. Now it's time for some EDA💥
MG_Vid1_yearwise=MG_Vid1.groupby(["Posted_year"]).sum()[["viewCount","likeCount"]]
MG_Vid1_yearwise
| viewCount | likeCount | |
|---|---|---|
| Posted_year | ||
| 2016 | 3391943 | 170325 |
| 2017 | 61016589 | 2281760 |
| 2018 | 194771586 | 8195491 |
| 2019 | 281685506 | 12337194 |
| 2020 | 265343400 | 13627555 |
| 2021 | 297612750 | 17994363 |
| 2022 | 271817978 | 14037297 |
fig = px.scatter(MG_Vid1,x="viewCount", y="likeCount", animation_frame="Posted_year",color="Posted_month",size="likeCount",
hover_name="Title",size_max=44)
fig.show()
vid= MG_Vid1.groupby(['Posted_year']).count()['Title']
print(vid)
Posted_year 2016 16 2017 169 2018 337 2019 349 2020 365 2021 366 2022 338 Name: Title, dtype: int64
#ploting Video count by year
fig = px.bar(vid,title="Video count by year")
fig.show()
fig=px.bar(MG_Vid1_yearwise,title="Like and view count by year")
fig.show()
fig = px.scatter(MG_Vid1,x="Posted_year",y="commentCount",title="Talk of the world",hover_name="Title",color="likeCount",size="likeCount")
fig.show()
fig = px.scatter(MG_Vid1,x="Duration_Time",y="likeCount",animation_frame="Posted_year",)
fig.show()